;---------------------------------------------------------------------------
;Protoman Stand Summon
[Statedef 7000]
type    = S
movetype= I
physics = N
velset = 2.2
ctrl = 0
anim = 7000
sprpriority = 3

[State 7000, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7000, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7000, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7000, 4]
type = PlaySnd
trigger1 = !Time
value = S40,0

[State 7000, 5]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7000, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7000, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7000, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7000, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7000, 10]
type = ChangeState
trigger1 = Time >= 8 && P2BodyDist X <= 55
value = 7001 

;---------------------------------------------------------------------------
;Protoman Stand Summon (Jump Shot)
[Statedef 7001]
type    = A
movetype= A
physics = N
velset = 2.2,-4.2
ctrl = 0
anim = 7002
sprpriority = 3

[State 7001, 1]
type = Gravity
trigger1 = 1

[State 7001, 2]
type = VarSet
trigger1 = PrevStateNo = 7002 && !Time
var(1) = 1

[State 7001, 3]
type = ScreenBound
trigger1 = 1
value = 0

[State 7001, 4]
type = PlayerPush
trigger1 = 1
value = 0  

[State 7001, 5]
type = VarSet
trigger1 = AnimElem = 2
fvar(3) = root,FVar(21)

[State 7001, 6]
type = Helper
trigger1 = AnimElem = 2
name = "Buster Shot"
ID = 7050+(2*(Var(1)))
stateno = 7005
pos = 25,-31
postype = p1    ;p2,front,back,left,right
facing = 1
ownpal = 1

[State 7001, 7]
type = Helper
trigger1 = AnimElem = 4
name = "Buster Shot"
ID = 7051+(2*(Var(1)))
stateno = 7005
pos = 25,-31
postype = p1    ;p2,front,back,left,right
facing = 1
ownpal = 1

[State 7001, 8]
type = ParentVarSet
trigger1 = AnimElem = 2 || AnimElem = 4
var(39) = 1

[State 7001, 9]
type = VarAdd
trigger1 = AnimElem = 2 || AnimElem = 4
var(11) = 1

[State 7011, 10]
type = PlaySnd
trigger1 = AnimElem = 2 || AnimElem = 4
value = S215,0
 
[State 7011, 11]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7011, 12]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7011, 13]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7002 
;---------------------------------------------------------------------------
;Protoman Stand Summon (Land)
[Statedef 7002]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7003
sprpriority = 3

[State 7002, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7002, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7002, 3]
type = PlayerPush
trigger1 = 1
value = 0   

[State 7011, 4]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7011, 5]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7002, 6]
type = ChangeState
trigger1 = !Var(1) && Time = 5
value = 7001

[State 7002, 7]
type = ChangeState
trigger1 = Var(1) && !Time
value = 7003
;---------------------------------------------------------------------------
;Protoman Stand Summon (Land, Stop)
[Statedef 7003]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7003
sprpriority = 3

[State 7003, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7003, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7003, 3]
type = PlayerPush
trigger1 = 1
value = 0   

[State 7003, 4]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7003, 5]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7003, 6]
type = NotHitBy
trigger1 = PrevStateNo = 7030
value = SCA
time = 1

[State 7003, 7]
type = ChangeState
trigger1 = Time = 10
value = 7020
;---------------------------------------------------------------------------
;Protoman Stand Summon (Bullet)
[Statedef 7005]
type    = S
movetype= A
physics = N
velset = 5.56,0
ctrl = 0
anim = 217
sprpriority = 3

[State 7005, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1
ignorehitpause = 1

[State 7005, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 7006
time = -1
ignorehitpause = 1

[State 7005, 3]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S,NP
hitflag = MAF
guardflag = MA
animtype = Light
priority = 4,Hit
getpower = 0,0
damage =  ceil(36*parent,Fvar(3)),9
pausetime = 1,1
sparkno = S6000
guard.sparkno = -1
sparkxy = -9, 0*floor(const(size.yscale))
hitsound = F5,0
guardsound = F6,0
ground.type = High
ground.slidetime = 8
guard.slidetime = 8
ground.hittime = 15
guard.hittime = 5
ground.velocity = -3.6*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -2.8, -1.5
id = 215
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7005, 4]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(!Var(26), Var(26) := 3,0)
ignorehitpause = 1

[State 7005, 5]
type = VarAdd
trigger1 = MoveHit = 1
var(1) = 1
ignorehitpause = 1

[State 7011, 6]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7011, 7]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7005, 8]
type = ChangeState
trigger1 = MoveContact
value = 7006

[State 7005, 9]
type = ChangeState
trigger1 = FrontEdgeDist < -40
trigger2 = Time = 20
trigger3 = MoveContact
value = 7007
;-------------------------------------------------------------------------
;Bullet Explod
[Statedef 7006]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 6001

[State 7006, 1]
type = ChangeAnim
trigger1 = Anim = 6001 && !AnimTime
value = 1

[State 7006, 2]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7006, 3]
type = DestroySelf
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;-------------------------------------------------------------------------
;Bullet Gone
[Statedef 7007]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 1

[State 7007, 1]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7007, 2]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Protoman Crouch Summon (Entrance)
[Statedef 7010]
type    = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7010
sprpriority = 3

[State 7010, 1]
type = PosSet
trigger1 = !Time
x = root,Pos X + 30*Facing

[State 7010, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7010, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7010, 4]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7010, 5]
type = PlaySnd
trigger1 = !Time
value = S40,0

[State 7000, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7000, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7010, 8]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7010, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7010, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7010, 11]
type = ChangeState
trigger1 = !Time
value = 7011
;---------------------------------------------------------------------------
;Protoman Crouch Summon (Land)
[Statedef 7011]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7011
sprpriority = 3

[State 7012, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7010, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7010, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7011, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7011, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7011, 8]
type = PlaySnd
trigger1 = !Time
value = S190,0

[State 7011, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7011, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7011, 11]
type = ChangeState
trigger1 = !AnimTime
value = 7012
;---------------------------------------------------------------------------
;Protoman Crouch Summon (Shield)
[Statedef 7012]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7012
sprpriority = 3

[State 7012, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7012, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7012, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7012, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA
stateno = 7030
time = -1

[State 7012, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA
time = -1

[State 7012, 6]
type = Helper
trigger1 = AnimElem = 2 
name = "Shield"
ID = 7010
stateno = 7013
pos = 20,0
postype = p1
facing = 1
ownpal = 1

[State 7012, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7012, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7012, 9]
type = ChangeState
trigger1 = !AnimTime
value = 7020 
;---------------------------------------------------------------------------
;Shield Hitbox
[Statedef 7013]
type    = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7013
sprpriority = 3

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time = 1
pos = 15,0

[State 7202, 1]
type = HitBy
trigger1 = 1
value = SCA,NP,SP
time = -1

[State 7202, 2]
type = HitOverride
trigger1 = 1
attr = SCA,NP,SP
slot = 0
stateno = 7013
time = -1

[State 7112, 9]
type = PlayerPush
trigger1 = 1 
value = 0

[State 7112, 10]
type = ScreenBound
trigger1 = 1 
value = 1

[State 7112, 11]
type = VarAdd
trigger1 = MoveHit = 1
var(1) = 1
ignorehitpause = 1

[State 7112, 13]
type = DestroySelf
trigger1 = !AnimTime || parent,StateNo != 7012
;---------------------------------------------------------------------------
;Protoman Leave
[Statedef 7020]
type    = S
movetype= I
physics = N
velset = -2.2
ctrl = 0
anim = 7000
sprpriority = 3

[State 7020, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7020, 2]
type = PlayerPush
trigger1 = 1
value = 0  

[State 7020, 3]
type = Turn
trigger1 = !Time

[State 7020, 4]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = -1

[State 7020, 5]
type = ChangeState
trigger1 = FrontEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7030]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 7030
velset = -2

[State 7030, 1]
type = Gravity
triggerall = StateType = A
trigger1 = 1

[State 7130, 4]
type = ParentVarAdd
trigger1 = !Time 
var(6) =  -100
ignorehitpause = 1

[State 5030, 5]
type = ChangeState
trigger1 = Time = 10 && StateType = S
trigger2 = StateType = A && Vel Y > 0 && Pos Y > -Vel Y
value = 7003

[State 7130, 5]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 5600
;---------------------------------------------------------------------------
;Ken Stand Summon (Entrance)
[Statedef 7100]
type    = A
movetype= A
physics = N
velset = ifelse(parent,FrontEdgeDist > 50,(ParentDist X + 20)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7100
sprpriority = 3

[State 7100, 1]
type = Gravity
trigger1 = 1

[State 7100, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7100, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7100, 4]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7100, 5]
type = PlaySnd
trigger1 = !Time
value = S7100,0

[State 7100, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7100, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7100, 8]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7010, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7010, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7100, 11]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7101

;---------------------------------------------------------------------------
;Ken Stand Summon (Punch)
[Statedef 7101]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 7101
sprpriority = 3

[State 7101, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7101, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7101, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7101, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7101, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7101, 6]
type = PlaySnd
trigger1 = AnimElem = 3 || AnimElem = 5 || AnimElem = 7 || AnimElem = 9
value = S7100,1

[State 7101, 7]
type = VarSet
trigger1 = AnimElem = 3
fvar(3) = root,FVar(21)

[State 7101, 8]
type = Helper
trigger1 = AnimElem = 3 || AnimElem = 7
name = "Punch Shot"
ID = 7050+(2*AnimElem = 7)
stateno = 7102
pos = 64,-41
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 7101, 9]
type = Helper
trigger1 = AnimElem = 5 || AnimElem = 9
name = "Punch Shot"
ID = 7051+(2*AnimElem = 9)
stateno = 7103
pos = 64,-41
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 7101, 10]
type = ParentVarSet
trigger1 = AnimElem = 3 || AnimElem = 5 || AnimElem = 7 || AnimElem = 9
var(39) = 1

[State 7101, 11]
type = VarAdd
trigger1 = AnimElem = 3 || AnimElem = 5 || AnimElem = 7 || AnimElem = 9
var(11) = 1

[State 7101, 12]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7101, 13]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7101, 14]
type = ChangeState
trigger1 = !AnimTime
value = 7120
;---------------------------------------------------------------------------
;Punch Shot
[Statedef 7102]
type    = A
movetype= A
physics = N
velset = 6.5,0
ctrl = 0
anim = 7102
sprpriority = 3

[State 7102, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1

[State 7102, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 7006
time = -1

[State 7102, 3]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S, SP
damage = ceil(40*parent,Fvar(3)),10
animtype = Hard
guardflag = MAF
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -6.2
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -5,-3
air.hittime = 100
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7102, 4]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(!Var(26), Var(26) := 3,0)
ignorehitpause = 1

[State 7102, 4]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = !(target,Time)
anim = 6001
ID = 7100
pos = -1,1
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 7102, 5]
type = PlaySnd
trigger1 = NumTarget && MoveHit
trigger1 = !(target,Time)
value = F5,2
ignorehitpause = 1

[State 7102, 6]
type = VelAdd
trigger1 = 1
y = -.2

[State 7102, 7]
type = VarSet
trigger1 = HitPauseTime = 1
var(1) = 1
ignorehitpause = 1

[State 7102, 8]
type = VarSet
trigger1 = HitPauseTime != 1
var(1) = 0
ignorehitpause = 1

[State 7101, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7101, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7102, 9]
type = ChangeState
trigger1 = MoveContact
value = 7006

[State 7102, 10]
type = ChangeState
trigger1 = Time = 20
value = 7007
;---------------------------------------------------------------------------
;Punch Shot (Down)
[Statedef 7103]
type    = A
movetype= A
physics = N
velset = 6.5,0
ctrl = 0
anim = 7102
sprpriority = 3

[State 1001, 4]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1

[State 1001, 5]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 7006
time = -1

[State 1001, 6]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S, SP
damage = ceil(35*parent,Fvar(3)),9
animtype = Hard
guardflag = MAF
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -6.2
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -5,-3
air.hittime = 100
;fall = 1
;fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1001, 7]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = !(target,Time)
anim = 6001
ID = 7100
pos = -1,1
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 1001, 8]
type = PlaySnd
trigger1 = NumTarget && MoveHit
trigger1 = !(target,Time)
value = F5,2
ignorehitpause = 1

[State 7215, 4]
type = VarSet
trigger1 = HitPauseTime = 1
var(1) = 1
ignorehitpause = 1

[State 7215, 5]
type = VarSet
trigger1 = HitPauseTime != 1
var(1) = 0
ignorehitpause = 1

[State 7101, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7101, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .2

[State 1001, 11]
type = ChangeState
trigger1 = MoveContact
value = 7006

[State 1001, 12]
type = ChangeState
trigger1 = Time = 20
value = 7007

;---------------------------------------------------------------------------
;Ken Crouch Summon (Entrance)
[Statedef 7110]
type    = A
movetype= A
physics = N
velset = ifelse(parent,FrontEdgeDist > 50,(ParentDist X + 20)/15,(ParentDist X)/15),-3.33
ctrl = 0
anim = 7100
sprpriority = 3

[State 7110, 1]
type = Gravity
trigger1 = 1

[State 7110, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7110, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7110, 4]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7110, 5]
type = PlaySnd
trigger1 = !Time
value = S7100,0

[State 7110, 6]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7110, 7]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7110, 8]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7110, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7110, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7110, 11]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7111

;---------------------------------------------------------------------------
;Ken Crouch Summon (Kick)
[Statedef 7111]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7111
sprpriority = 3

[State 7111, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = S7100,1

[State 7111, 2]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7111, 3]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7111, 4]
type = Helper
trigger1 = AnimElem = 3
name = "Kick Shot"
ID = 7050
stateno = 7112
pos = 16,-30
postype = p1    ;p2,front,back,left,right
facing = 1
ownpal = 1

[State 7111, 6]
type = ParentVarSet
trigger1 = AnimElem = 18
var(39) = 1

[State 7111, 6]
type = VarAdd
trigger1 = AnimElem = 18
var(11) = 1

[State 7111, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7111, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7111, 9]
type = ChangeState
trigger1 = !AnimTime
value = 7120
;---------------------------------------------------------------------------
;Ken Crouch Summon (Kick)
[Statedef 7112]
type    = A
movetype= A
physics = N
velset = 7,-6
ctrl = 0
anim = 7112
sprpriority = 3

[State 7112, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 7112, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 7006
time = -1

[State 7112, 3]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S, SP
damage = ceil(115*root,Fvar(21)),29
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 21
guard.hittime  = 10
ground.velocity = -2, -8.8
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.3,-6.5
air.hittime = 100
fall = 1
fall.recover = 0
;fall = 1
;fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7112, 4]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = !(target,Time)
anim = 6001
ID = 3001
pos = -1,1
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 7112, 4]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7112, 5]
type = PlaySnd
trigger1 = NumTarget && MoveHit
trigger1 = !(target,Time)
value = F5,2
ignorehitpause = 1

[State 7112, 6]
type = VelAdd
trigger1 = 1
x = -.18

[State 7112, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 71121, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7112, 9]
type = VarSet
triggerall = MoveHit
trigger1 = HitPauseTime = 1
var(1) = 1
ignorehitpause = 1

[State 7112, 10]
type = VarSet
triggerall = MoveHit
trigger1 = HitPauseTime != 1
var(1) = 0
ignorehitpause = 1

[State 7112, 11]
type = ChangeState
trigger1 = MoveContact
value = 7006

[State 7112, 12]
type = ChangeState
trigger1 = Time = 25
value = 7007
;---------------------------------------------------------------------------
;Ken Leave
[Statedef 7120]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 7100
sprpriority = 3

[State 7120, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7120, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7120, 3]
type = StateTypeSet
trigger1 = AnimElem = 1
statetype = A       
physics = N      

[State 7120, 3]
type = VelSet
trigger1 = AnimElem = 1
x = -10
y = -9.13

[State 7120, 4]
type = Gravity
trigger1 = Time >= 14

[State 7120, 5]
type = PlaySnd
trigger1 = AnimElem = 1
value = S7100,0

[State 7120, 6]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = -1

[State 7120, 7]
type = ChangeState
trigger1 = BackEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7130]
type    = A
movetype= H
physics = N
ctrl = 0
anim = 7130
velset = 0,-6.2

[State 7130, 1]
type = Gravity
trigger1 = StateType = A

[State 7130, 3]
type = ChangeState
trigger1 = (StateType = A) && (!AnimTime)
value = 7131

[State 7130, 3]
type = ChangeState
trigger1 = (StateType = S) && (!AnimTime)
trigger2 = (StateType = A) && (Vel Y > 0 && Pos Y > -Vel Y)
value = 7132

[State 7130, 4]
type = ParentVarAdd
trigger1 = !Time 
var(6) =  -100
ignorehitpause = 1

[State 7130, 5]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7140
;---------------------------------------------------------------------------
; HIT_LAND
[Statedef 7131]
type    = A
movetype= H
physics = N
ctrl = 0
anim = 7130

[State 7130, 1]
type = Gravity
trigger1 = StateType = A

[State 7131, 2]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7132
;---------------------------------------------------------------------------
; HIT_LAND
[Statedef 7132]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7131

[State 7132, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7131, 2]
type = ChangeState
trigger1 = Time = 30
value = 7120
;---------------------------------------------------------------------------
;Ken Defeated
[Statedef 7140]
type    = L
movetype= H
physics = N
sprpriority = -3
velset = 0,-.7
anim = 7140
ctrl = 0

[State 7040, 3]
type = PlaySnd
trigger1 = Time = 0
value = S7130,0
channel = 10

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 3
y = 0

[State 7040, 4]
type = DestroySelf
trigger1 = !AnimTime
;---------------------------------------------------------------------------
;Firebrand Stand Summon (Entrance)
[Statedef 7200]
type    = A
movetype= A
physics = N
velset = ifelse(parent,FrontEdgeDist > 70,(ParentDist X + 20)/15,(ParentDist X)/15),-3
ctrl = 0
anim = 7200
sprpriority = 3

[State 7200, 1]
type = Gravity
trigger1 = 1

[State 7200, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7200, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7200, 4]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7200, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7200, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7200, 7]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7200, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7200, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7200, 10]
type = PlaySnd
trigger1 = !Time
value = S7200,0

[State 7200, 11]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7201

;---------------------------------------------------------------------------
;Firebrand Stand Summon (Shoot)
[Statedef 7201]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7201
sprpriority = 3

[State 7201, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7201, 2]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7201, 3]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7201, 4]
type = Helper
trigger1 = AnimElem = 4
name = "Tornado"
ID = 7050
stateno = 7205
pos = 32,-31
postype = p1
facing = 1
ownpal = 1

[State 7201, 5]
type = ParentVarSet
trigger1 = AnimElem = 4
var(39) = 1

[State 7201, 6]
type = VarAdd
trigger1 = AnimElem = 4
var(11) = 1

[State 7201, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7201, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7201, 9]
type = PlaySnd
trigger1 = AnimElem = 4
value = S7200,1

[State 7201, 10]
type = ChangeState
trigger1 = !AnimTime
value = 7220
;---------------------------------------------------------------------------
;Tornado
[Statedef 7205]
type    = A
movetype= A
physics = N
velset = 3,0
ctrl = 0
anim = 7205
sprpriority = 3

[State 7205, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7205, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7205, 3]
type = HitOverride
trigger1 = 1
attr = SCA,HP
slot = 0
stateno = 7006
time = -1

[State 7205, 4]
type = HitBy
trigger1 = 1
value = SCA,HP
time = 1

[State 7205, 5]
type = Helper
trigger1 = !Time
name = "Tornado Helper"
ID = 7205
stateno = 7206 
pos = 0,0
postype = p1
facing = 1
ownpal = 1

[State 7205, 6]
type = VelSet
trigger1 = Time = 25
x = 0

[State 7205, 7]
type = HitDef
trigger1 = root,var(5) < 10
attr = S, SP
damage = ceil(70*root,Fvar(21)),18
animtype = Hard
guardflag = MAF
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -2.2
ground.cornerpush.veloff = 0
air.type = High
air.velocity = 1.5,-3
air.hittime = 100
fall = 1
fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7205, 8]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7205, 9]
type = PlaySnd
triggerall = NumTarget && MoveHit
trigger1 = target, Time = 0
value = F5,2
ignorehitpause = 1

[State 7205, 10]
type = Explod
triggerall = NumTarget
trigger1 = target, Time = 0
anim = 6001
ID = 7100
pos = -1,1
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 7205, 11]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7205, 12]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7205, 13]
type = VarSet
trigger1 = HitPauseTime = 1
var(1) = 1
ignorehitpause = 1

[State 7205, 14]
type = VarSet
trigger1 = HitPauseTime != 1
var(1) = 0
ignorehitpause = 1

[State 7205, 15]
type = PlaySnd
trigger1 = !Time
value = S7205,0

[State 7205, 16]
type = ChangeState
trigger1 = Time = 180
value = 7207

[State 7205, 17]
type = ChangeState
trigger1 = NumTarget && MoveContact
value = 7006
;---------------------------------------------------------------------------
;Tornado Helper
[Statedef 7206]
type    = A
movetype= A
physics = N
velset = 3,0
ctrl = 0
anim = 7206
sprpriority = 3

[State 7205, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7205, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7205, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SP
slot = 0
stateno = 7206
time = -1

[State 7205, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SP
time = 1

[State 7205, 5]
type = BindToParent
trigger1 = 1
time = 1
pos = 0,0

[State 7205, 6]
type = DestroySelf
trigger1 = parent,StateNo != 7205

;---------------------------------------------------------------------------
;Tornado Die
[Statedef 7207]
type    = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7207
sprpriority = 3

[State 7207, 1]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7207, 2]
type = DestroySelf
trigger1 = !AnimTime

;---------------------------------------------------------------------------
;Firebrand Crouch Summon (Entrance)
[Statedef 7210]
type    = S
movetype= I
physics = N
velset = 3
ctrl = 0
anim = 7210
sprpriority = 3

[State 7210, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7210, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7210, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7210, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7210, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7210, 6]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7210, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7210, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7210, 9]
type = ChangeState
trigger1 = BackEdgeDist > 20
value = 7211
;---------------------------------------------------------------------------
;Firebrand Crouch Summon (Jump)
[Statedef 7211]
type    = A
movetype= I
physics = N
velset = 0,-10
ctrl = 0
anim = 7200
sprpriority = 3

[State 7210, 1]
type = Gravity
trigger1 = 1

[State 7210, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7210, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7210, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7210, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7210, 7]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7210, 8]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7210, 9]
type = PlaySnd
trigger1 = !Time
value = S7200,0

[State 7210, 10]
type = ChangeState
trigger1 = Vel Y > 1
value = 7212
;---------------------------------------------------------------------------
;Firebrand Crouch Summon (Dive)
[Statedef 7212]
type    = A
movetype= A
physics = N
velset = 7,10
ctrl = 0
anim = 7212
sprpriority = 3

[State 7212, 1]
type = VelAdd
trigger1 = 1
y = -.9

[State 7210, 2]
type = Gravity
trigger1 = 1

[State 7210, 3]
type = ScreenBound
trigger1 = 1
value = 0

[State 7210, 4]
type = PlayerPush
trigger1 = 1
value = 0

[State 7210, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7210, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7210, 7]
type = HitDef
trigger1 = root,var(5) < 10 && !Time
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
damage = ceil(120*root,Fvar(21)),30
pausetime = 3,5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,-20*floor(const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = Low
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 14
ground.velocity = -4.6, -2.5
ground.cornerpush.veloff = 0
air.type = Low
air.hittime = 100
air.velocity = -4.1, -1.4
fall = 1
fall.recover = 0
id = 7200
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7210, 8]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7210, 8]
type = ParentVarAdd
trigger1 = HitPauseTime = 1
var(2) = 1
ignorehitpause = 1

[State 7210, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 7210, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 7210, 11]
type = ChangeState
trigger1 = ScreenPos Y < -25
value = 7300
;---------------------------------------------------------------------------
;Firebrand Leave
[Statedef 7220]
type    = S
movetype= I
physics = N
velset = -3
ctrl = 0
anim = 7210
sprpriority = 3

[State 7220, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7220, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7220, 3]
type = Turn
trigger1 = !Time

[State 7220, 4]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 7220, 5]
type = ChangeState
trigger1 = FrontEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7230]
type    = A
movetype= H
physics = N
ctrl = 0
anim = 7230
velset = -3,-4.3

[State 7230, 1]
type = Gravity
trigger1 = 1

[State 7230, 2]
type = VelSet
trigger1 = Time = 44
x = 0

[State 7230, 3]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7231

[State 7230, 4]
type = ParentVarAdd
trigger1 = !Time 
var(6) =  -100
ignorehitpause = 1

[State 7230, 5]
type = PlaySnd
trigger1 = !Time
value = S7230,0

[State 7230, 6]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7240
;---------------------------------------------------------------------------
; HIT_LAND
[Statedef 7231]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7231

[State 7131, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 7131, 2]
type = ChangeState
trigger1 = Time = 35
value = 7220
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7240]
type    = A
movetype= H
physics = N
ctrl = 0
anim = 7240
velset = 0,0

[State 7240, 1]
type = Explod
trigger1 = Time = 24
anim = 7241
ID = 7240
pos = -17,-32
postype = p1
facing = 1
vfacing = 1
bindtime = 1
vel = -3,-3
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 5
ownpal = 1

[State 7240, 2]
type = Explod
trigger1 = Time = 24
anim = 7241
ID = 7240
pos = -17,-16
postype = p1
facing = 1
vfacing = 1
bindtime = 1
vel = -3,3
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 5
ownpal = 1

[State 7240, 3]
type = Explod
trigger1 = Time = 24
anim = 7241
ID = 7240
pos = 17,-32
postype = p1
facing = 1
vfacing = 1
bindtime = 1
vel = 3,-3
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 5
ownpal = 1

[State 7240, 4]
type = Explod
trigger1 = Time = 24
anim = 7241
ID = 7240
pos = 17,-16
postype = p1
facing = 1
vfacing = 1
bindtime = 1
vel = 3,3
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 5
ownpal = 1

[State 7240, 5]
type = PlaySnd
trigger1 = !Time
value = S7240,0

[State 7240, 6]
type = DestroySelf
trigger1 = !AnimTime
;---------------------------------------------------------------------------
;Helper Gone
[Statedef 7300]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 1
velset = 0,0
sprpriority = 3

[State 7300, 1]
type = ParentVarSet
trigger1 = Var(11) = Var(10)
var(39) = 0
ignorehitpause = 1

[State 7300, 2]
type = ParentVarSet
trigger1 = !Time
var(38) = 0
ignorehitpause = 1

[State 7300, 3]
type = DestroySelf
triggerall = !(root,Var(38)) && !(root,Var(39))
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L